﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for QLloaitu
/// </summary>
public class QLloaitu
{
    ConnectionProcess cp = new ConnectionProcess();
	public QLloaitu()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public DataTable Load_loaitu()
    {
        return cp.Get_data("Load_loaitu");
    }
    public void Them_loaitu(string ten)
    {
        SqlParameter p1 = new SqlParameter("@tenloaitu",ten);
        cp.thuchienlenh("Them_loaitu",p1);
    }
    public DataTable Load_tenloaitu(int matu)
    {
        SqlParameter p1 = new SqlParameter("@matu",matu);
        return cp.Get_data("Load_tenloaitu",p1);

    }
    public string Load_strtenloaitu(int matu)
    {
        SqlParameter p1 = new SqlParameter("@matu", matu);
        object kq=cp.Get_data("Load_tenloaitu", p1);
        return kq.ToString();
    }
    public void update_loaitu(int ma,string ten)
    {
        SqlParameter p1 = new SqlParameter("@matu", ma);
        SqlParameter p2 = new SqlParameter("@tenloaitu", ten);
        cp.thuchienlenh("update_loaitu", p1, p2);
    }
}